/* log.h */

#ifndef LOG_H_
#define LOG_H_

#define NAME_LEN 32

typedef struct logfile{
	FILE *log_file;
	int log_num;
	int max_order_id;
} logfile_t;

typedef struct log{
	int order_id;
	time_t order_time;
	int user_id;
	char train_no[16];
	time_t time;
	int ticket_num;
	char other[256];
} log_t;

logfile_t *logfile_open(const char *path);

int logfile_close(logfile_t * file);

int add_log(logfile_t *file, log_t *log);

int parse_log(log_t * log, const char * line);

#endif /* LOG_H_ */
